Vue.component('v-chart', VueECharts)
new Vue({
    el: '#app',
    data: function () {
        return {
            isReady: true, //数据是否已经准备好,防止页面闪现大括号{{}}
            activeDialogIndex: '', //模态窗索引
            tab: 1,
            stat1: {

            },
            stat2: {
                productList: new Array(12).fill({
                    name: '这里是产品名称',
                    qy: '武汉生物',
                    qslrzl: '1000'
                })
            },
            stat3: {
                chartOption: {}
            },
            stat4: {
                chartOption: {},
                productList: new Array(4).fill({
                    name: 'XXX产品',
                    lrzl: 1000,
                    xszl: 20,
                    kczl: 980
                }),
                tipInfo: { //提示框
                    data: {
                        name: '',
                        value: '',
                        otherValue: {
                            lrzl: 0,
                            ycfyfss: 0,
                            ycfyfsl: 0
                        }
                    },
                    position: {
                        x: '-',
                        y: '-'
                    }
                }
            }

        }
    },
    created: function () {
        // this.createStat3()
        this.createStat4()
    },
    methods: {
        submitForm: function () {},

        createStat3: function () { //i类疫苗近半年使用量及异常反应量
            var lableList = ['2019-02', '2019-03', '2019-04', '2019-05', '2019-06', '2019-07']
            var dataList = [
                [4420, 3200, 3300, 3350, 2350, 1250],
                [420, 200, 300, 350, 350, 250]
            ]
            this.stat3.chartOption = AllOptions.createOption3(lableList, dataList)
        },
        createStat4: function () {
            var that = this;

            var dataList = [
                [{
                    name: '宁波市',
                }, {
                    name: '杭州市',
                    value: {
                        lrzl: 65231,
                        ycfyfss: 800,
                        ycfyfsl: 200
                    }
                }],
                [{
                    name: '宁波市',
                }, {
                    name: '湖州市',
                    value: {
                        lrzl: 65231,
                        ycfyfss: 800,
                        ycfyfsl: 200
                    }
                }],

            ];
            $.get('/src/js/zj.json', function (mapJson) {
                that.stat4.chartOption = AllOptions.createOption4(mapJson, dataList)
            })
        },
        hoverMap: function (item) {
            this.stat4.tipInfo = {
                data: item.data,
                position: {
                    x: item.event.offsetX,
                    y: item.event.offsetY
                }
            }
        },
        goBack() {
            window.history.go(-1)
        }
    }
})